<template>
  <div class="login">
    <Form v-show="!$route.meta.coverParent"></Form>
    <router-view></router-view>
  </div>
</template>

<script>
import Form from '../components/Form.vue'
import { Toast } from 'vant'
export default {
  name: 'Login',
  components: {
    Form
  },
  data () {
    return {

    }
  },
  watch: {

  },
  // 路由守卫
  beforeRouteEnter: (to, from, next) => {
    // 判断是否登录
    if (!localStorage.getItem('token')) {
      next()
    } else {
      // eslint-disable-next-line no-undef
      Toast('已登录')
      next({ path: '/handpick' })
    }
  },
  mounted () {

  },
  methods: {

  }
}

</script>
<style scoped lang='scss'>
  ::v-deep body{
    background-color: #fff;
  }
</style>
